package org.business.accounting.components;

import java.util.Collection;

import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Grid;
import org.business.accounting.interfaces.BasicProduct;

@SuppressWarnings("unused")
public class BuyOrOrder {
	
	@Parameter(required = true)
	@Property
	private boolean isAdmin;
	
	@Parameter(required = true)
	@Property
	private Collection<BasicProduct> source;
	
	@Parameter
	@Property
	private BasicProduct row;
	
	@Parameter
	@Property
	private String exclude;
	
	@Component(parameters = {
			"source = source"})
	private Grid grid;
	
	public String getActionName() {
		if (isAdmin) {
			return "order";
		} else {
			return "buy";
		}
	}

}
